//
// Decompiled by Jadx - 357ms
//
package r;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.graphics.Color;
import android.widget.Toast;
import au.d;
import com.google.gson.Gson;
import fn.y;
import gc.aa;

public final class f {
    public static Toast a;
    public final Activity b;
    public Toast c;
    public int d = 80;
    public int e = -1;
    public int f = -16777216;
    public boolean h = true;
    public int g = 1;

    public f(Activity activity) {
        this.b = activity;
    }

    public static f i() {
        f fVar = new f(y.by.getActivity());
        fVar.n();
        return fVar;
    }

    public final void j() {
        int parseColor = Color.parseColor("#D81D24");
        this.f = parseColor;
        this.e = d.c(parseColor, 30);
    }

    public final void k() {
        int parseColor = Color.parseColor("#0095D7");
        this.f = parseColor;
        this.e = d.c(parseColor, 30);
    }

    @SuppressLint({"ResourceType", "SetTextI18n"})
    public final synchronized Toast l(String str) {
        if (str == null) {
            str = "Null";
        }
        Activity activity = this.b;
        if (activity == null) {
            return null;
        }
        if (this.e == -1) {
            if (e.c(activity)) {
                this.f = Color.parseColor("#CCCCCC");
                this.e = Color.parseColor("#1A1A1A");
            } else {
                this.f = -16777216;
                this.e = -1;
            }
        }
        this.b.runOnUiThread(new aa(9, this, str));
        return this.c;
    }

    public final void m(Object obj) {
        l(obj == null ? "[Null]" : new Gson().toJson(obj));
    }

    public final void n() {
        int parseColor = Color.parseColor("#27903A");
        this.f = parseColor;
        this.e = d.c(parseColor, 30);
    }
}
